package vip.buddha.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import vip.buddha.entity.Account;
import vip.buddha.service.AccountService;

@RestController
public class AccountController {
    @Autowired
    private AccountService accountService;

    @RequestMapping("/account/list")
    public String list() {
        return "this is account list api";
    }

    @PutMapping("/account/{userId}")
    public Integer update(@PathVariable("userId") Integer userId, @RequestBody Account account) {
        Integer o = accountService.updateByUserId(userId, account);
        System.out.println(o);
        return o;
    }
}
